package java56_7;

public class Sonar {// 声纳扫描侦查水底
	String name;

	public void scanning(Swimming s) {

		s.swim();

	}

	public static void main(String[] args) {
		Dolphin d = new Dolphin();
		Submarine s = new Submarine();
		Sonar sm = new Sonar();
		sm.scanning(d);
		sm.scanning(s);
	}

}
